home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 5.4 KB | 188 lines | [TEXT/MPS ] |
- ;
- ; File: Notification.a
- ;
- ; Contains: Notification Manager interfaces
- ;
- ; Version: Technology: System 7.5
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__NOTIFICATION__') = 'UNDEFINED' THEN
- __NOTIFICATION__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
- IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
- include 'OSUtils.a'
- ENDIF
- ENDIF
- IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN
- include 'Collections.a'
- ENDIF
- IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
- include 'Kernel.a'
- ENDIF
- ; ------------------
- IF FOR_SYSTEM8_PREEMPTIVE THEN
-
-
- ; notification status flags
-
- kInvalidNotification EQU 1 ; notification ref invalid
- kUnSentNotification EQU 2 ; notification not yet sent
- kPostedNotification EQU 3 ; notification has been posted
- ; typedef UInt32 NotificationStatus
-
- ; notification tags
-
- kNotificationTypeTag EQU 'type' ; type of notification (multiple types allowed)
- kNotificationRefTag EQU 'nref' ; notification ref (usually retrieved at completion)
- kTextNotificationTag EQU 'text' ; ASCII text
- kTextObjectNotificationTag EQU 'tobj' ; text object model format text
- kSoundNotificationTag EQU 'snd ' ; sound data in format of 'snd ' resource
- kSmall8BitIconTag EQU 'ics8' ; 8-bit icon
- kSmall4BitIconTag EQU 'ics4' ; 4-bit icon
- kSmall1BitMaskIconTag EQU 'ics#' ; 1-bit icon w/mask
- kProcessSerialNumberTag EQU 'psn ' ; psn we wish to mark
- ; notification module identifiers
-
- kAlertNotifier EQU 'alrt' ; display a modal alert with OK button
- kSoundNotifier EQU 'snd ' ; play a sound
- kProcessMenuNotifier EQU 'pmnu' ; flash icon in title of process menu
- kAppleMenuNotifier EQU 'amnu' ; flash icon in title of apple menu
- kMenuMarkNotifier EQU 'mmrk' ; put a mark in the process menu
- ; typedef OSType NotifierType
-
- ; notification posting options
-
- kAutoDisposeOnCompletionMask EQU $00000001 ; dispose the notification request on completion
- ; typedef OptionBits NotificationOptions
-
- ; ------------------
- ;
- ; pascal OSStatus NewNotificationRef(NotificationRef *notification)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION NewNotificationRef
- ENDIF
-
- ;
- ; pascal OSStatus AddNotificationCollectionItem(NotificationRef notification, CollectionTag tag, UInt32 id, void *itemData, ByteCount itemSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION AddNotificationCollectionItem
- ENDIF
-
- ;
- ; pascal OSStatus GetNotificationCollectionItem(NotificationRef notification, CollectionTag tag, UInt32 id, void **dataPtr, ByteCount *itemSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetNotificationCollectionItem
- ENDIF
-
- ;
- ; pascal OSStatus PostNotification(NotificationRef notification, const KernelNotification *completion, Duration timeOut, NotificationOptions postingOptions)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION PostNotification
- ENDIF
-
- ;
- ; pascal NotificationStatus GetNotificationStatus(NotificationRef notification)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetNotificationStatus
- ENDIF
-
- ;
- ; pascal OSStatus DisposeNotificationRef(NotificationRef notification)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION DisposeNotificationRef
- ENDIF
-
- ;
- ; pascal OSStatus NewNotificationRefFromMemory(void *messageBuffer, ByteCount size, NotificationRef *notification)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION NewNotificationRefFromMemory
- ENDIF
-
- ;
- ; pascal ByteCount GetFlattenedNotificationSize(NotificationRef notification)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION GetFlattenedNotificationSize
- ENDIF
-
- ;
- ; pascal OSStatus FlattenNotification(NotificationRef notification, void *buffer)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION FlattenNotification
- ENDIF
-
- ENDIF
- ; ------------------
- ; ------------------
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
-
-
- ; typedef NMRec * NMRecPtr
-
- NMRec RECORD 0
- qLink ds.l 1 ; offset: $0 (0) ; next queue entry
- qType ds.w 1 ; offset: $4 (4) ; queue type -- ORD(nmType) = 8
- nmFlags ds.w 1 ; offset: $6 (6) ; reserved
- nmPrivate ds.l 1 ; offset: $8 (8) ; reserved
- nmReserved ds.w 1 ; offset: $C (12) ; reserved
- nmMark ds.w 1 ; offset: $E (14) ; item to mark in Apple menu
- nmIcon ds.l 1 ; offset: $10 (16) ; handle to small icon
- nmSound ds.l 1 ; offset: $14 (20) ; handle to sound record
- nmStr ds.l 1 ; offset: $18 (24) ; string to appear in alert
- nmResp ds.l 1 ; offset: $1C (28) ; pointer to response routine
- nmRefCon ds.l 1 ; offset: $20 (32) ; for application use
- sizeof EQU * ; size: $24 (36)
- ENDR
- ; ------------------
- ;
- ; pascal OSErr NMInstall(NMRecPtr nmReqPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; nmReqPtr => A0
- ; returns:
- ; OSErr <= D0
- _NMInstall: OPWORD $A05E
- ELSE
- IMPORT_CFM_FUNCTION NMInstall
- ENDIF
-
- ;
- ; pascal OSErr NMRemove(NMRecPtr nmReqPtr)
- ;
- IF ¬ GENERATINGCFM THEN
- ; parameters:
- ; nmReqPtr => A0
- ; returns:
- ; OSErr <= D0
- _NMRemove: OPWORD $A05F
- ELSE
- IMPORT_CFM_FUNCTION NMRemove
- ENDIF
-
- ENDIF
- ; ------------------
- ENDIF ; __NOTIFICATION__
-
-